Skip to content

[feat] db auto-migration - #9

Closed
brandonkachen wants to merge 5 commits into
mainfrom
brandon/db
Closed

brandonkachen wants to merge 5 commits into
mainfrom
brandon/db

Conversation

@brandonkachen

@brandonkachen brandonkachen commented Sep 20, 2024 •

Copy link
Copy Markdown
Contributor
🚀 This description was created by 4eca428

feat: add db auto-migration with Drizzle ORM

Summary:

Introduces database auto-migration using Drizzle ORM, refactors database setup, and updates package scripts and dependencies.

Key points:

  • Database Migration:
    • Removed old migration scripts and configurations from backend/src/db.
    • Added docker-compose.yml in common/src/db for local PostgreSQL setup.
    • Added drizzle.config.ts and env.mjs in common/src/db for Drizzle ORM configuration.
    • Added index.ts in common/src/db to initialize database connection using Drizzle ORM.
  • Package Updates:
    • Updated common/package.json to include new scripts for database generation and migration.
    • Updated backend/package.json and web/package.json to remove old migration scripts.
    • Added dependencies for Drizzle ORM and PostgreSQL in common/package.json.
  • Code Refactoring:
    • Moved database schema from web/db/schema.ts to common/src/db/schema.ts.
    • Updated imports in auth-options.ts and webhook/route.ts to use new database setup.

Generated with ❤️ by ellipsis.dev

@ellipsis-dev ellipsis-dev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Changes requested. Reviewed everything up to 4eca428 in 36 seconds

More details
  • Looked at 540 lines of code in 26 files
  • Skipped 2 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. common/package.json:32
  • Draft comment:
    The dotenv package is listed as a dependency in multiple package.json files. Consider consolidating it to avoid redundancy and potential version conflicts.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The dotenv package is listed as a dependency in multiple package.json files, which could lead to redundancy and version conflicts. It should be consolidated to avoid these issues.

Workflow ID: wflow_2hQt4ON8TaBwfLSO


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

⌛ 2 days left in your free trial, upgrade for $20/seat/month or contact us.

Comment thread common/src/db/env.mjs

const DOTENV_PATH = process.env.ENVIRONMENT === 'local' ? '..' : '/etc/secrets'
const path = `${DOTENV_PATH}/.env.${process.env.ENVIRONMENT}`
console.log(`Using environment: ${process.env.ENVIRONMENT} (path: ${path})`)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logging the environment path might expose sensitive information. Consider removing this log or handling it securely.

@ellipsis-dev

ellipsis-dev Bot commented Sep 20, 2024

Copy link
Copy Markdown

Skipped PR review on 986866d because no changed files had a supported extension. If you think this was in error, please contact us and we'll fix it right away.


Generated with ❤️ by ellipsis.dev

@brandonkachen
brandonkachen temporarily deployed to brandon/db - backend PR #10 September 20, 2024 01:57 — with Render Destroyed
@brandonkachen
brandonkachen deleted the brandon/db branch September 20, 2024 02:07
EstarinAzx added a commit to EstarinAzx/codebuff-modded that referenced this pull request May 19, 2026
…uffAI#9)

_post.ts had opencode-go threaded through both ladder branches (stream
+ non-stream): a useOpenCodeGo declaration + 5+ subsequent `&& !useOpenCodeGo &&`
guards in every later provider's gate + a slot in the ternary tower.
Every upstream provider addition collides at the slot fork picked plus
re-flows the guard chain. Two parallel ladders meant two hot zones.

Moved both dispatches to web/src/fork-impls/provider-dispatch.ts:
`tryForkProviderStream` / `tryForkProviderNonStream` return the
provider handler's normal output when the model matches, else `null`.
Upstream ladders now dispatch the fork's overrides BEFORE the chain:

  const forkX = await tryForkProviderX(model, baseArgs)
  // ... upstream useXyz declarations + ternary tower unchanged ...
  const result = forkX ?? (upstream-ternary)

baseArgs construction moved one block earlier so the fork dispatch can
take the same args. Upstream `useOpenCodeGo` declaration + 11 guard
references + 2 ternary legs deleted; remaining lines are byte-identical
to upstream pattern.

Error handling block kept as-is: handleOpenCodeGo* still throws
OpenCodeGoError which the upstream catch normalizes for status + provider
attribution. Only the dispatch path changes.

handleOpenCodeGoStream / handleOpenCodeGoNonStream / isOpenCodeGoModel
imports moved out of _post.ts into the fork-impl module. OpenCodeGoError
import stays in _post.ts for the catch.

Verified by typecheck. Smoke verification against a real opencode-go
key still owed (this branch is pre-validation).

Reduces upstream merge conflict on _post.ts from a multi-zone fork edit
(two ladders + threaded guards) to one fork-dispatch line per ladder.
JasonMMIV added a commit to JasonMMIV/Anybuff that referenced this pull request Sep 7, 2026
…run guardrails, theme mode, mentions

Close six items from the APP gap list (CodebuffAI#4, CodebuffAI#9, CodebuffAI#11, CodebuffAI#17, CodebuffAI#18, CodebuffAI#20):
- CodebuffAI#4 image attachments/clipboard paste: RunImagePart contracts + multimodal
  RunPromptPayload.content -> client.run({content}); composer paste & thumbnails
- CodebuffAI#9 bash mode (!command): host-core runBashCommand channel (scrubbed env,
  timeout clamp, truncation) + <user_terminal_commands> context baking
- CodebuffAI#11 <PLAN> blocks render as a bordered plan box card in AssistantBubble
- CodebuffAI#17 maxAgentSteps/costMode: persisted settings + updateRunGuardrails,
  forwarded to client.run; composer Steps/Cost quick selects
- CodebuffAI#18 theme follows system: 3-way system/light/dark selector with
  matchMedia listener and nativeTheme sync (bump to 1.1.0)
- CodebuffAI#20 @mention: custom-agent completion from 3-tier .agents scan, Tab path
  completion, agentId override routed through runPrompt

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>

This branch was successfully deployed

No deployments
brandon/db - backend PR #10 — 986866db Deployed Sep 20, 2024 by brandonkachen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant